<template>
  <div>
    <el-button size="mini" type="primary" @click="toConfig">配置</el-button>
    <configForm ref="configForm" :dict="dict" :sup_this="sup_this" :is-add="false"/>
  </div>
</template>
<script>
import configForm from './configform'
export default {
  components: { configForm },
  props: {
    data: {
      type: Object,
      required: true
    },
    sup_this: {
      type: Object,
      required: true
    },
    dict: {
      type: Object,
      required: true
    }
  },
  methods: {
    toConfig() {
      const _this = this.$refs.configForm
      _this.form = {
        id: this.data.id,
        workerDevicesArray:this.data.workerDevices?this.data.workerDevices.split(","):[],
        workerDevices:this.data.workerDevices,
        deviceName: this.data.deviceName,
        deviceIp: this.data.deviceIp,
        devicePort: this.data.devicePort,
        devicePoint: this.data.devicePoint,
        deviceArea: this.data.deviceArea,
        refreshRate: this.data.refreshRate,
        deviceNum: this.data.deviceNum,
        deviceType: this.data.deviceType,
        deviceModel: this.data.deviceModel,
        deviceGrade: this.data.deviceGrade,
        deviceBrand: this.data.deviceBrand,
        manufacturer: this.data.manufacturer,
        creator: this.data.creator,
        createTime: this.data.createTime,
        updator: this.data.updator,
        updateTime: this.data.updateTime
      }
      _this.dialog = true
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
